import { windowList } from '@/global/window/window';
import useUserStore from '@/store/user';
import { userRouters } from '@/views/desktop/apps/data';
import { logout } from './user';

export const userLogout = async () => {
  const userStore = useUserStore();

  userStore.$state = {
    history: [],
    userInfo: undefined,
    token: '',
  };
  windowList.value = [];
  userRouters.value = [];
  await logout();
};
